import GraphBack from '../../src'
function draw() {
  document.querySelectorAll('.graph-background').forEach((ele) => drawBackground(ele))
}
window.addEventListener('resize', () => draw())

function drawBackground(ele) {
  const board = new GraphBack.Board(ele, { color: '#235fa7' })
  const points = GraphBack.Convert(board, [
    [5, 5],
    [-20, 5],
    [-20, -20],
    [5, -20]
  ])
  const transform = new GraphBack.Transform(new GraphBack.Polyline({ points, close: true })).array(3, 5, 5)
  board.add(transform)
  ele.style.background = board.getStyle()
}
